<?php

namespace App\Http\Requests\Api\Order;

use App\Http\Requests\Api\BaseRequest;
use App\Models\Order;

class OrderPayRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'order_sn'=>[
            	'required',
				'exists:order,order_sn'
//				function($attribute,$value,$fail){
//        			$order = Order::query()->where([
//        				'order_sn'=>$value,
//						'user_id'=>auth('api')->id(),
//					])->first();
//
//        			if(!$order){
//        				return $fail('订单不存在');
//        			}
//				}
			],
        ];
    }

	public function attributes()
    {
		return [
			'order_sn'=>'订单'
		];
    }
}
